package de.alfenory.autobill.config;

/**
 *
 * @author alefen
 */
public class TypeConfiguration {
    private int mapping_beforeterm_monthly;
    private int mapping_afterterm_monthly;
    private int mapping_beforeterm_quarterly;
    private int mapping_afterterm_quarterly;
    private int mapping_beforeterm_halfyearly;
    private int mapping_afterterm_halfyearly;
    private int mapping_beforeterm_yearly;
    private int mapping_afterterm_yearly;
    private int mapping_beforeterm_twoyearly;
    private int mapping_afterterm_twoyearly;
    private int mapping_beforeterm_tenyearly;
    private int mapping_afterterm_tenyearly;

    public TypeConfiguration(int mapping_beforeterm_monthly, int mapping_afterterm_monthly, int mapping_beforeterm_quarterly, int mapping_afterterm_quarterly, int mapping_beforeterm_halfyearly, int mapping_afterterm_halfyearly, int mapping_beforeterm_yearly, int mapping_afterterm_yearly, int mapping_beforeterm_twoyearly, int mapping_afterterm_twoyearly, int mapping_beforeterm_tenyearly, int mapping_afterterm_tenyearly) {
        this.mapping_beforeterm_monthly = mapping_beforeterm_monthly;
        this.mapping_afterterm_monthly = mapping_afterterm_monthly;
        this.mapping_beforeterm_quarterly = mapping_beforeterm_quarterly;
        this.mapping_afterterm_quarterly = mapping_afterterm_quarterly;
        this.mapping_beforeterm_halfyearly = mapping_beforeterm_halfyearly;
        this.mapping_afterterm_halfyearly = mapping_afterterm_halfyearly;
        this.mapping_beforeterm_yearly = mapping_beforeterm_yearly;
        this.mapping_afterterm_yearly = mapping_afterterm_yearly;
        this.mapping_beforeterm_twoyearly = mapping_beforeterm_twoyearly;
        this.mapping_afterterm_twoyearly = mapping_afterterm_twoyearly;
        this.mapping_beforeterm_tenyearly = mapping_beforeterm_tenyearly;
        this.mapping_afterterm_tenyearly = mapping_afterterm_tenyearly;
    }

    public int getMapping_afterterm_halfyearly() {
        return mapping_afterterm_halfyearly;
    }

    public int getMapping_afterterm_monthly() {
        return mapping_afterterm_monthly;
    }

    public int getMapping_afterterm_quarterly() {
        return mapping_afterterm_quarterly;
    }

    public int getMapping_afterterm_twoyearly() {
        return mapping_afterterm_twoyearly;
    }

    public int getMapping_afterterm_yearly() {
        return mapping_afterterm_yearly;
    }

    public int getMapping_beforeterm_halfyearly() {
        return mapping_beforeterm_halfyearly;
    }

    public int getMapping_beforeterm_monthly() {
        return mapping_beforeterm_monthly;
    }

    public int getMapping_beforeterm_quarterly() {
        return mapping_beforeterm_quarterly;
    }

    public int getMapping_beforeterm_twoyearly() {
        return mapping_beforeterm_twoyearly;
    }

    public int getMapping_beforeterm_yearly() {
        return mapping_beforeterm_yearly;
    }

    public int getMapping_afterterm_tenyearly() {
        return mapping_afterterm_tenyearly;
    }

    public int getMapping_beforeterm_tenyearly() {
        return mapping_beforeterm_tenyearly;
    }
    
    public boolean isBeforeTermMonthly(int termId) {
        return termId == this.mapping_beforeterm_monthly;
    }
    
    public boolean isAfterTermMonthly(int termId) {
        return termId == this.mapping_afterterm_monthly;
    }
    
    public boolean isBeforeTermQuarterly(int termId) {
        return termId == this.mapping_beforeterm_quarterly;
    }
    
    public boolean isAfterTermQuarterly(int termId) {
        return termId == this.mapping_afterterm_quarterly;
    }
    
    public boolean isBeforeTermHalfyearly(int termId) {
        return termId == this.mapping_beforeterm_halfyearly;
    }
    
    public boolean isAfterTermHalfyearly(int termId) {
        return termId == this.mapping_afterterm_halfyearly;
    }
    
    public boolean isBeforeTermYearly(int termId) {
        return termId == this.mapping_beforeterm_yearly;
    }
    
    public boolean isAfterTermYearly(int termId) {
        return termId == this.mapping_afterterm_yearly;
    }
    
    public boolean isBeforeTermTwoYearly(int termId) {
        return termId == this.mapping_beforeterm_twoyearly;
    }
    
    public boolean isAfterTermTwoYearly(int termId) {
        return termId == this.mapping_afterterm_twoyearly;
    }
    
    public boolean isBeforeTermTenYearly(int termId) {
        return termId == this.mapping_beforeterm_tenyearly;
    }
    
    public boolean isAfterTermTenYearly(int termId) {
        return termId == this.mapping_afterterm_tenyearly;
    }
    
    public boolean isAfterTerm(int termId) {
        return 
                termId == this.mapping_afterterm_halfyearly ||
                termId == this.mapping_afterterm_monthly ||
                termId == this.mapping_afterterm_quarterly ||
                termId == this.mapping_afterterm_twoyearly ||
                termId == this.mapping_afterterm_yearly || 
                termId == this.mapping_afterterm_tenyearly;
    }
    
    public int getPeriode(int termId) {
        int periode = 1;
        if(termId == this.mapping_afterterm_halfyearly) periode = 6;
        if(termId == this.mapping_afterterm_monthly) periode = 1;
        if(termId == this.mapping_afterterm_quarterly) periode = 3;
        if(termId == this.mapping_afterterm_tenyearly) periode = 120;
        if(termId == this.mapping_afterterm_twoyearly) periode = 24;
        if(termId == this.mapping_afterterm_yearly) periode = 12;
        if(termId == this.mapping_beforeterm_halfyearly) periode = 6;
        if(termId == this.mapping_beforeterm_monthly) periode = 1;
        if(termId == this.mapping_beforeterm_quarterly) periode = 3;
        if(termId == this.mapping_beforeterm_tenyearly) periode = 120;
        if(termId == this.mapping_beforeterm_twoyearly) periode = 24;
        if(termId == this.mapping_beforeterm_yearly) periode = 12;
        return periode;
    }
    
}
